function showPanel(showPanelId){
	 var showPanel = document.getElementById(showPanelId).value;
	 for(i=1;i<20;i++){
		 if(showPanel==i){
		 	Richfaces.showModalPanel('modalPanel'+i); 
		 }
	 }
}

function deleteShow(listTableId,modalPanelId){
	var TableData = document.getElementById(listTableId);
	var CheckAll = document.getElementById(listTableId+":selectAll");
	var index = 0;
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		if (TableData != null && CheckAll != null) {
			for (var i = 1; i < TableData.rows.length - 1; i++) {
				var ckbox = TableData.rows(i).cells(0).children.item(0);
				if (ckbox != null && ckbox.checked) {
					index++;
				}
			}
		}
	} else {
		if (TableData != null && CheckAll != null) {
			for (var i = 0; i < TableData.rows.length - 1; i++) {
				if (document.getElementById(listTableId+":" + i
						+ ":isSelect").checked) {
					index++;
				}
			}
		}
	}
	if (index == 0) {
		ymPrompt.errorInfo({title:'操作错误信息',message:'请选择记录'});
	} else {
		if(CheckAll != null) {
			CheckAll.checked = false;
		}
		Richfaces.showModalPanel(modalPanelId);
	}
}

function deleteShowWithNo(listTableId,modalPanelId,no){
	var TableData = document.getElementById(listTableId);
	var CheckAll = document.getElementById(listTableId+":selectAll");
	var index = 0;
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		if (TableData != null && CheckAll != null) {
			for (var i = 1; i < TableData.rows.length - no; i++) {
				var ckbox = TableData.rows(i).cells(0).children.item(0);
				if (ckbox != null && ckbox.checked) {
					index++;
				}
			}
		}
	} else {
		if (TableData != null && CheckAll != null) {
			for (var i = 0; i < TableData.rows.length - no; i++) {
				if (document.getElementById(listTableId+":" + i
						+ ":isSelect").checked) {
					index++;
				}
			}
		}
	}
	if (index == 0) {
		ymPrompt.errorInfo({title:'操作错误信息',message:'请选择记录'});
	} else {
		if(CheckAll != null) {
			CheckAll.checked = false;
		}
		Richfaces.showModalPanel(modalPanelId);
	}
}

function hiddenPanelWithShowPanelIdReset(showPanelId,modalPanelId){
	 document.getElementById(showPanelId).value = '';
	 Richfaces.hideModalPanel(modalPanelId);
}

function resetShowPanel(showPanelId){
	document.getElementById(showPanelId).value = '';
}

function hiddenPanel(modalPanelId){
	 Richfaces.hideModalPanel(modalPanelId);
}

Richfaces.showModalPanel = function (id, opts, event) {
	var panel = $(id);
	if (!panel) {
		panel = Richfaces.findModalPanel(id);
	}
	panel.component.show(event, opts);

};
